package com.laopan.wxpay;

/**
 * 微信常量
 * @author laopan
 * @date 2021/4/5 0005 17:20
 */
public interface WxConstants {
    /**
     * 支付的url.正式。
     */
    String PAY_HOST_URL = "https://api.mch.weixin.qq.com";

    /**
     * 直连支付-统一下单。
     */
    String APP_PAY_PATH = "/v3/pay/transactions/app";
    String JSAPI_PAY_PATH = "/v3/pay/transactions/jsapi";
    String NATIVE_PAY_PATH = "/v3/pay/transactions/native";
    String H5_PAY_PATH = "/v3/pay/transactions/h5";

    String WX_QUERY_PATH = "/v3/pay/transactions/id/";
    String MCH_QUERY_PATH = "/v3/pay/transactions/out-trade-no/";

    /**
     * 退款地址
     */
    String REFUND_PATH = "/v3/refund/domestic/refunds";


    /**
     * wx 证书下载地址。
     */
    String PATH_CERTIFICATES = "/v3/certificates";

    /**
     * 微信支付基本域名后缀
     */
    String WX_BASE_URL_SUFFIX = ".mch.weixin.qq.com";

    /**
     * 微信权限固定头信息
     */
    String WX_AUTH_HEAD_FIXED = "";
    String CERTIFICATES_SUFFIX = "_cert.pem";
    String PRIVATE_KEY_SUFFIX = "_private_key.pem";
    String DEFAULT_ROOT_PATH = "/pem";
    /**
     * 微信支付V3版本前缀
     */
    String AUTH_HEADER_PREFIX = "WECHATPAY2-SHA256-RSA2048";
    String CONTENT_TYPE_JSON = "application/json";


    String LOCK_CERTIFICATES = "certificates_get:";


    /**
     * 如下定义了微信返回的header内容。
     */
    String H_REQUEST_ID = "Request-ID";
    String HEADER_WX_SERIAL = "Wechatpay-Serial";
    String HEADER_WX_SIGNATURE = "Wechatpay-Signature";
    String HEADER_WX_TIMESTAMP = "Wechatpay-Timestamp";
    String HEADER_WX_NONCE = "Wechatpay-Nonce";
    /**
     * 回调状态
     */
    String PAY_CALLBACK_SUCCESS = "TRANSACTION.SUCCESS";
    String REFUND_CALLBACK_SUCCESS = "REFUND.SUCCESS";
    String REFUND_CALLBACK_EXCEPTION = "REFUND.ABNORMAL";
    String REFUND_CALLBACK_CLOSE = "REFUND.CLOSED";
}
